package com.durian.ui.span;

import android.text.TextPaint;
import android.text.style.AbsoluteSizeSpan;

/**
 * 说明：NormalSpan
 * <p/>
 * 作者：fanly
 * <p/>
 * 时间：2018/7/2 14:21
 * <p/>
 * 版本：version 1.0
 */
public class NormalSpan extends AbsoluteSizeSpan {

    private SpanSetting setting;

    public NormalSpan(SpanSetting setting,int size) {
        super(size);
        this.setting = setting;
    }

    @Override
    public void updateDrawState(TextPaint ds) {
        super.updateDrawState(ds);
        ds.setAntiAlias(true);
        ds.setColor(setting.getColor());
        ds.setStrikeThruText(setting.isStrikeThrough());
        ds.setUnderlineText(setting.isUnderLine());
        ds.setFakeBoldText(setting.isBold());
    }
}
